package com.stylefeng.guns.admin.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.mapper.LogMapper;
import com.stylefeng.guns.pojo.OperationLog;
import com.stylefeng.guns.admin.service.ILogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional
public class LogServiceImpl extends ServiceImpl<LogMapper, OperationLog> implements ILogService {

    @Autowired
    LogMapper logMapper;

    @Override
    public List<Map<String, Object>> getOperationLogs(Page<OperationLog> page, String beginTime, String endTime, String logName, String logType, String orderByField, boolean isAsc) {
        return logMapper.getOperationLogs(page, beginTime, endTime, logName, logType, orderByField, isAsc);
    }

    @Override
    public List<Map<String, Object>> getLoginLogs(Page<OperationLog> page, String beginTime, String endTime, String logName, String orderByField, boolean isAsc) {
        return logMapper.getLoginLogs(page, beginTime, endTime, logName, orderByField, isAsc);
    }
}
